﻿using Qianke.Core.Common.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;

namespace Qianke.Core.Saas.Contracts.BaseService
{
    public interface ISaasBaseService<TPrimaryKey, TGetModelOutputDto, TAddOrUpdateInputDto, TGetPageInputDto, TGetPageOutputDto> : IRemoteService
    {

        /// <summary>
        /// 获取模型
        /// </summary>
        /// <param name="entityDto"></param>
        /// <returns></returns>
        Task<TGetModelOutputDto> GetModel(EntityInputDto<TPrimaryKey> entityDto);

        /// <summary>
        /// 新增或者更新模型
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<TGetModelOutputDto> AddOrUpdate(TAddOrUpdateInputDto dto);

        /// <summary>
        /// 兼容老代码，保存模型
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<TGetModelOutputDto> SaveModel(TAddOrUpdateInputDto dto);

        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<PageOutputDto<TGetPageOutputDto>> GetPage(TGetPageInputDto dto);


        /// <summary>
        /// 删除模型
        /// </summary>
        /// <param name="entityDto"></param>
        /// <returns></returns>
        Task<TPrimaryKey> Delete(EntityInputDto<TPrimaryKey> entityDto);
    }
}
